<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>涨停板</title>
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="jqtimes.js"></script>


</head>

<body>
    <table id="dg"></table>
    <script>
        let codeurl = "http://axiba.idnmd.top:8500/api/ZhangTing";
        function reflsh() {
            $('#dg').datagrid({
                url: codeurl,
                method: 'get',
                columns: [[
                    { field: 'code', title: '代码' },
                    { field: 'name', title: '名称' },
                    { field: 'zhangfu', title: '涨幅' },
                    { field: 'zuihou', title: '最后封板' },
                    {
                        field: 'lianban', title: '连板',
                        styler: function (value, row, index) {
                            if (value > 1) {
                                return 'background-color:#ffee00;color:red;';
                            }else if(value == 1){

                            }else{
                                return 'background-color:#81ecec;';
                            }
                        }
                    },
                    {
                        field: 'liutong', title: '流通',
                        styler: function (value, row, index) {
                            if (value.split('.')[0] > 200) {
                                return 'background-color:#b671a7;color:red;';
                            }
                        }
                    },
                    { field: 'gainina', title: '概念', align: 'left' }
                ]],
                striped: true,
                onClickRow: function (index, row) {
                    console.log(row);
                    let gotocode = row.code;

                    let gourl = "http://www.treeid/code_" + gotocode;
                    console.log(gourl);
                    self.location = gourl;
                }
            });

        }
        reflsh();
        $('body').everyTime('30s', function () {
            reflsh()
        });



    </script>
</body>

</html>